package com.fac.dto;

import com.fac.constant.UserType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Data
@ApiModel(description = "用户分页查询参数")
public class UsersPageQueryDTO implements Serializable {

    @ApiModelProperty(value = "搜索关键字(用户名或真实姓名)", example = "张三")
    private String keyword;

    @ApiModelProperty(value = "用户类型", example = "WORKER", allowableValues = "WORKER,RENTAL_FACTORY,BORROWING_FACTORY,REPAIR_FACTORY,ADMIN")
    private UserType userType;

    @NotNull(message = "页码不能为空")
    @Min(value = 1, message = "页码必须大于0")
    @ApiModelProperty(value = "页码", required = true, example = "1")
    private Integer page = 1;

    @NotNull(message = "每页记录数不能为空")
    @Min(value = 1, message = "每页记录数必须大于0")
    @ApiModelProperty(value = "每页记录数", required = true, example = "10")
    private Integer size = 10;
}
